In this demo, you
will learn about surface components in
the Material-UI library. Several surface
components are defined on the official website of
the Material library, such as accordion app
bar, card, and paper. Surface components
are used to display the content for users
in various formats. For example, the content is displayed in various
texts formats in a card. You can also show
the content using an enhanced or a complex
interactive card for more aesthetic and
appealing look to users. Moving to the code, you have the surface.jsx file that
mainly imports the avatar, card, card media, and card content components
from the Material package. Content can be displayed after iterating over the
card component. The card data
contains several data and you map the card data
to show within a card. The card component wraps
some sub-components, such as card media that
displays images to users, card content that shows textual or extra
information of data. To import a surface
component in app.js, go to home.jsx where you have imported the
surface component. The service component renders only the data passed by you, so you can reuse the component
for various purposes. The home component wraps
the surface component. The home component displays
the surface component into the app component with a different tab panel demonstrated in the
navigational demos. Now, save and execute the code. In the application,
the home component has the surface components
wrapped into it. The surface components show different card
component data with images and textual information. In this way, you can
show the content using surface
components. Thank you.